package esb.chapter8.errorhandling.camel;

import org.apache.camel.builder.RouteBuilder;

public class CamelErrorHandler extends RouteBuilder {
	
	private final static String NAMESPACE = "http://esbinaction.com/errorhandling";
	private final static String SERVICE_IN = "jbi:service:" + 
		NAMESPACE + "/errorHandlerDSL";
	private final static String BEAN_IN = "jbi:service:" + 
		NAMESPACE + "/errorComponent";
	private final static String ERROR_IN = "jbi:service:" + 
		NAMESPACE + "/errorStorageService";
	
	public void configure() {
		from(SERVICE_IN).
			errorHandler(deadLetterChannel(ERROR_IN).maximumRedeliveries(2)).
		to(BEAN_IN);
	}

}
